<?php
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=exceldata.xls");
header("Pragma: no-cache");
header("Expires: 0");
?> 
<table border="1" cellpadding="3" cellspacing="0" width="100%" style=" border-collapse: collapse;" class="record">
                <tr align="center">
                    <td colspan="12" height="25">Laporan Kwitansi</td>
                </tr>
                <?php if ($jenis=="J"){?>
                <tr align="center">
                    <td>No Kwitansi</td>
                    <td>Tanggal Kwitansi</td>
                    <td>No Faktur</td>
                    <td>Nama Pelanggan</td>                    
                    <td>Total Quantity</td>                    
                    <td>Total Amount</td>
                    <td>Type bayar</td>
                    <td>Bank Penerima</td>
                    <td>Bank Pelanggan</td>
                    <td>Rekening Pelanggan</td>
                    <td>Keterangan</td>
                    <td>Nama Pembuat</td>
                </tr>
                <?php 
					foreach($data as $items) 
					{
				?> 
                <tr class="cellDefault">
                    <td><?php echo $items->NoKwitansi;?></td>
					<td><?php echo $items->CreatedOn;?></td>
                    <td><?php echo $items->NoFaktur;?></td>
                    <td><?php echo $items->namapelanggan;?></td>
                    <td><?php echo $items->TotalQuantity;?></td>
                    <td><?php echo $items->TotalAmount;?></td>
                    <td><?php echo $items->Typebayar;?></td>
                    <td><?php echo $items->KodeBankpenerimaan;?></td>
                    <td><?php echo $items->Banknamepelanggan;?></td>
                    <td><?php echo $items->NoRekeningpelanggan;?></td>
                    <td><?php echo $items->Keterangan;?></td>
                    <td><?php echo $items->CreatedBy;?></td>
                </tr>
                <?php 
					} 
				}else{
				?>
                <tr align="center">
                	<td>No Kwitansi</td>
                    <td>Tanggal Kwitansi</td>
                    <td>Total Quantity</td>
                    <td>Type bayar</td>
                    <td>Total Amount</td>
                    <td>Keterangan</td>
                    <td>Nama Pembuat</td>
                </tr>
                <?php 
					foreach($data as $items) 
					{
				?> 
                <tr class="cellDefault">
                    <tr class="cellDefault">
                    <td><?php echo $items->NoKwitansi;?></td>
					<td><?php echo $items->CreatedOn;?></td>
                    <td><?php echo $items->TotalQuantity;?></td>
                    <td><?php echo $items->Typebayar;?></td>
                    <td><?php echo $items->TotalAmount;?></td>
                    <td><?php echo $items->Keterangan;?></td>
                    <td><?php echo $items->CreatedBy;?></td>
                </tr>
                </tr>
                <?php 
					} 
                 } ?>
            </table> 